Skip to content

fix: error on conflicting assertions#155

Open
lucacasonato wants to merge 1 commit intodenoland:mainfrom
lucacasonato:conflicting_assertions
Open

fix: error on conflicting assertions#155
lucacasonato wants to merge 1 commit intodenoland:mainfrom
lucacasonato:conflicting_assertions

Conversation

@lucacasonato
Copy link
Member

Previously, if a specifier was imported more than once, with conflicting
assertions, we'd only really consider the final import. This is wrong:
conflicting assertions are an error in-themselves already. I think this
behaviour is still wrong, because if a module is imported with incorrect
assertions later in the graph after the module has already been loaded by
an import with a correct assertion, no error will be raised.

Previously, if a specifier was imported more than once, with conflicting
assertions, we'd only really consider the final import. This is wrong:
conflicting assertions are an error in-themselves already. I think this
behaviour is still wrong, because if a module is imported with incorrect
assertions later in the graph after the module has already been loaded by
an import with a correct assertion, no error will be raised.
@nayeemrmn
Copy link
Collaborator

Long term we should do this with #132 instead, and associate import assertion errors with each import. With per-import errors being a third kind on top of resolution errors and module slot errors. Maybe this patches some error cases, but the data modelling wrt import assertions is still in a very bad state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants